'use strict';
const fs = require('fs');
module.exports = appInfo => {
  const config = exports = {};


  config.alipay = {
    appId: '2016091600526207',
    privateKey: fs.readFileSync(__dirname + '/key/private-key.pem', 'ascii'),
    alipayPublicKey: fs.readFileSync(__dirname + '/key/ali-public-key.pem', 'ascii'),
    seller_id: '2088102175918543',
  };
  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1534658186159_9730';
  config.cors = {
    origin: '*',
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
  };
  // add your config here
  config.middleware = [ 'errorHandler' ];
  config.mysql = {
    client: {
      host: 'localhost',
      port: '3307',
      user: 'root',
      password: '123',
      database: 'mzhuoyi',
    },
    // 是否加载到app
    app: true,
    // 是否加载到agent
    agent: false,
  };
  config.jwt = {
    secret: 'Great4-M',
    enable: true, // default is false
    match: '/jwt', // optional
  };
  config.security = {
    csrf: {
      enable: false,
    },
    domainWhiteList: [
      '.alipaydev.com',
    ],
  };
  return config;
};
